import { FILTER_ACTIVE } from "../constants"

const initState = {
  arr: ['all', 'active', 'completed'],
  active: 'all'
}
export default function filter(preStete = initState, action) {
  const { type, data } = action
  switch (type) {
    case FILTER_ACTIVE:
      return { ...preStete, active: data }
    default:
      return preStete
  }
}